package com.desaysv.wandroid.adapter;

import android.content.Context;

import com.desaysv.wandroid.entity.BannerEntity;
import com.desaysv.wandroid.utils.GlideApp;
import com.youth.banner.adapter.BannerImageAdapter;
import com.youth.banner.holder.BannerImageHolder;

import java.util.List;

/**
 * @author linzi
 * @date 2022-11-16
 */
public class BannerAdapter extends BannerImageAdapter<BannerEntity> {
    private Context mContext;
    public BannerAdapter(Context context, List<BannerEntity> mData) {
        super(mData);
        mContext=context;
    }

    @Override
    public void onBindView(BannerImageHolder holder, BannerEntity data, int position, int size) {
        GlideApp.with(mContext).load(data.getImagePath()).fitCenter().into(holder.imageView);
    }
}
